<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<style>
    * {
        margin: 0;
        padding: 0;
        box-sizing: border-box;
    }
    
    label {
        display: block;
        margin-left: 30px;
        margin-top: 30px;
    }
    
    .btn.switch {
        position: relative;
        width: 120px;
        height: 60px;
        outline: none;
        cursor: pointer;
        background: #fff;
        border-radius: 30px;
        appearance: none;
        -moz-appearance: none;
        -webkit-appearance: none;
        box-shadow: -5px -5px 20px rgba(33, 66, 99, 0.1), 5px 5px 10px rgba(33, 66, 99, 1), inset -2px -2px 5px rgba(33, 66, 99, 0.1), inset 2px 2px 5px rgba(33, 66, 99, 1), 0 0 0 2px #336699;
    }
    
    .btn.switch::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 80px;
        height: 60px;
        background: linear-gradient(to top, #99CCFF, #336699);
        border-radius: 30px;
        box-shadow: 0 0 0 1px #336699;
        transform: scale(0.98, 0.96);
        transition: 0.5s;
    }
    
    .btn.switch:checked::before {
        left: 40px;
    }
</style>

<body>
    <label><input type="checkbox" class="btn switch"></label>

</body>

</html>